package com.hmall.item.interceptor;

public class UserThreadLocal {
    private static ThreadLocal<Long> t1 = new ThreadLocal<>();

    /**
     * 获取用户id
     * @return
     */
    public static Long get(){return t1.get();}

    /**
     * 设置用户id
     */
    public static void set(Long userId){ t1.set(userId);}
    /**
     * 释放本地线程
     */
    public static void remove(){ t1.remove(); }
}
